package com.zjgxzh.dialogservice.mapper;

import com.zjgxzh.dialogservice.pojo.Summary;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SummaryMapper {

    @Select("SELECT * FROM summary WHERE thread_id = #{threadId}")
    Summary findSummaryByThreadId(String threadId);

    @Insert("INSERT INTO summary (thread_id, content, username) VALUES (#{threadId},#{content},#{username})")
    void addSummary(Summary summary);

    @Update("UPDATE summary SET content = #{content} WHERE thread_id = #{threadId}")
    void updateSummary(Summary summary);
}
